import json

numbers = 'jkjkfs'

filename = 'username.json'
with open(filename, 'w') as f_obj:
    json.dump(numbers, f_obj)


def get_stored_username():
    filename = 'username.json'
    try:
        with open(filename) as f_obj:
            username = json.load(f_obj)
    except FileNotFoundError:
        return None
    else:
        return username


def get_new_username():
    username = input('what is your name')
    filename = 'username.json'
    with open(filename, 'w') as f_obj:
        json.dump(username, f_obj)
    return username

def greet_user():
    username = get_stored_username()
    print('usesrname', username)
    if username:
        print("welcome back, " + username + '!')
    else:
        username = get_new_username()
        print("we'll remeber you when you come back, " + username + '!')

greet_user()
